
<div class="bs-old-docs">
  <div class="container">
    <?php echo $this->Html->link('  Nueva Orden de Servicio', array('controller' => 'ServiceOrders', 'action' => 'add'),  array('class' => 'glyphicon glyphicon-plus-sign btn btn-primary btn-lg' )); ?>
  </div>
</div>

<script type="text/javascript">
    $(document).ready(function() {
        $('#browserList').dataTable({
            "bProcessing": true,
            "bServerSide": true,
            "sAjaxSource": "<?php echo $this->Html->Url(array('controller' => 'Grid', 'action' => 'serviceOrderGrid')); ?>"
        });
    });
    
    function loadDataTable(){
    	$("#browserList").dataTable().fnDestroy();
    	$('#browserList').dataTable({
            "bProcessing": true,
            "bServerSide": true,
            "sAjaxSource": "<?php echo $this->Html->Url(array('controller' => 'Grid', 'action' => 'serviceOrderGrid')); ?>"
        });
    }
    
    function loadDataTable2(){
    $("#browserList").dataTable().fnDestroy();
	$('#browserList').dataTable({
        "bProcessing": true,
        "bServerSide": true,
        "sAjaxSource": "<?php echo $this->Html->Url(array('controller' => 'Grid', 'action' => 'serviceOrderRowGrid')); ?>"
    });
    }
    
	function btnServiceOrder_Click() {
	  
	  loadDataTable();
	};
	
	function btnServiceOrderRow_Click() {
	  
	  loadDataTable2();
	};
</script>


<!-- <h2>Ordenes de Servicio</h2> -->
 
<table id="browserList" class="browserList table table-striped"" >
    <thead>
        <tr>
            <th>ID</th>
            <th>NOMBRE CLIENTE</th>
            <th>COD CLIENTE</th>
            <th>NRO ORDEN DE SERVICIO</th>
            <th>FECHA INGRESO</th>
            <th>FECHA RETIRO</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td colspan="4" class="dataTables_empty">Loading data from server...</td>
        </tr>
    </tbody>
</table>

<?php $this->Html->addCrumb('Ordenes de Servicio', '/ServiceOrders'); ?>
</div>